<template>
  <div>
    <el-table :data="tableData" border>
      <el-table-column
        v-for="(val, key) in cols"
        :key="key"
        :prop="key"
        :label="val"
      >
      </el-table-column>
      <template v-if="showOperating">
        <el-table-column
          fixed="right"
          label="操作"
        >
          <template slot-scope="scope">
            <slot name="operating" :data="{index: scope.$index,data: scope.row}"></slot>
          </template>
        </el-table-column>
      </template>
    </el-table>
  </div>
  
</template>

<script>
export default {
  name: "LoanTable",
  props: {
    cols: {
      type: Object,
      default: function () {
        return {}
      }
    },
    tableData: {
      type: Array,
      default: function () {
        return []
      }
    },
    showOperating: {
      type: Boolean,
      default: true
    }
  }
}
</script>

<style scoped>

</style>